

#ifndef UDB_API_DBACIS_H
#define UDB_API_DBACIS_H

#include "zacdb.h"
#pragma pack (push, 8)

class UcDbDwgFiler;
class UcDbDxfFiler;
class AcDbObject;
class ENTITY;

extern "C"
{
	void ucdbModelerStart();
	void ucdbModelerEnd();
	ZSoft::Boolean ucdbIsModelerStarted();

	Ucad::ErrorStatus ucdbAcisSaveEntityToDwgFiler     (UcDbDwgFiler* filer, 
		ENTITY*       ent);
	Ucad::ErrorStatus ucdbAcisRestoreEntityFromDwgFiler(UcDbDwgFiler* filer, 
		ENTITY*&      ent);
	Ucad::ErrorStatus ucdbAcisSaveEntityToDxfFiler     (UcDbDxfFiler* filer, 
		ENTITY*       ent); 
	Ucad::ErrorStatus ucdbAcisRestoreEntityFromDxfFiler(UcDbDxfFiler* filer, 
		ENTITY*&      ent);

	void           ucdbAcisSetDeleteBulletins(ZSoft::Boolean onOff);
	ZSoft::Boolean ucdbAcisGetDeleteBulletins();

	ZSoft::Boolean ucdbSetAcisDwgVer(int version);

	void           ucdbAcisDeleteModelerBulletins(void);
}

enum ModelerRestoreOptions
{
	kReadForeignEntities			= 0x01,
	kReadUnknownEntities			= 0x02,
	kLoseUnknownCustomAttributes	= 0x04,
	kReadStrangerEntityDefault		= (kReadForeignEntities | kReadUnknownEntities | kLoseUnknownCustomAttributes), 
	kModelerRestoreOptionsFuture1	= 0x08,
	kModelerRestoreOptionsFuture2	= 0x10,
	kModelerRestoreOptionsFuture3	= 0x20,
	kModelerRestoreOptionsFuture4	= 0x40,
};


Ucad::ErrorStatus ucdbModelerSaveEntityToDwgFiler     (UcDbDwgFiler* filer, 
	ENTITY*       ent,
	UcDbDatabase* pDb,
	int modelerVersion = -1);
Ucad::ErrorStatus ucdbModelerRestoreEntityFromDwgFiler(UcDbDwgFiler* filer, 
	ENTITY*&      ent,
	int* pModelerVersion = nullptr,
	unsigned restoreOptions = kReadStrangerEntityDefault);
Ucad::ErrorStatus ucdbModelerSaveEntityToDxfFiler     (UcDbDxfFiler* filer, 
	ENTITY*       ent, 
	UcDbDatabase* pDb,
	int modelerVersion = -1); 
Ucad::ErrorStatus ucdbModelerRestoreEntityFromDxfFiler(UcDbDxfFiler* filer, 
	ENTITY*&      ent,
	int* pModelerVersion = nullptr,
	unsigned restoreOptions = kReadStrangerEntityDefault);



#pragma pack (pop)
#endif
